package com.bgs.eat.commodityOrder.service.impl;

import com.bgs.eat.commodityOrder.entity.CommodityOrderComplaintEntityTwoTable;
import com.bgs.eat.commodityOrder.mapper.CommodityOrderComplaintMapper;
import com.bgs.eat.commodityOrder.service.CommodityOrderComplaintService;
import com.bgs.eat.commodityOrder.service.CommodityOrderService;
import com.bgs.eat.page.MyPageHelper;
import com.bgs.eat.page.PageRequest;
import com.bgs.eat.page.PageResult;
import com.bgs.eat.shop.entity.ShopEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @ClassName CommodityOrderComplaintServiceImpl
 * @Description TODO
 * @Author cjl
 * @Date 2022/10/26 14:41
 **/
@Service
public class CommodityOrderComplaintServiceImpl implements CommodityOrderComplaintService {

    @Autowired
    CommodityOrderComplaintMapper commodityOrderComplaintMapper;

    @Override
    public PageResult selectCommodityOrderComplaintEntityTwoTable(Integer resolutionStatus, Integer roleId, Integer countyId, PageRequest pageRequest) {
        if (roleId == 6){
            MyPageHelper.startPage(pageRequest);
            List<CommodityOrderComplaintEntityTwoTable> list = commodityOrderComplaintMapper.selectCommodityOrderComplaintEntityTwoTableRoleId(resolutionStatus,countyId);
            return MyPageHelper.pageInfo(list);
        } else {
            MyPageHelper.startPage(pageRequest);
            List<CommodityOrderComplaintEntityTwoTable> list = commodityOrderComplaintMapper.selectCommodityOrderComplaintEntityTwoTable(resolutionStatus);
            return MyPageHelper.pageInfo(list);
        }
    }
}
